import Cookies from 'js-cookie'

export function getToken(str) {
  return Cookies.get(str)
}

export function setToken(str, value, time) {
  if (time) {
    time = new Date(new Date().getTime() + time)
    return Cookies.set(str, value, {
      expires: time
    })
  } else {
    return Cookies.set(str, value)
  }
}

export function removeToken(str) {
  return Cookies.remove(str)
}
